const express = require('express')
const app = express();


const cors = require('cors');
app.use(cors());

const readFileMiddleware = require('./middleware/readFile')
app.use(readFileMiddleware);

require('./routes/index')(app)

app.listen(3000, () => {
    console.log('server is running at http://localhost:3000');
})

const WebSocketService = require("./service/web_socket_service");
//监听客户端连接
//连接成功后对message事件的监听
WebSocketService.listen()